<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
      .mask{
        position: fixed;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        z-index: 1000;
        background-color: rgba(0,0,0,.7);
        display: flex;
        justify-content: center;
        align-items: center;
      }
      .content{
        width: 40%;
        height: 40%;
        background-color: #fff;
      }
  </style>
</head>
<body>
  <div id="app">
      <button @click="showModal">显示弹窗框</button>
      <div class="mask" v-show="isShow" @click.self="hideModal">
        <div class="content">
          <button>内容1</button>
          <button>内容1</button><button>内容1</button><button>内容1</button>
        </div>
      </div>
  </div>
  <script src="./vue.global.js"></script>
  <script>
    const { createApp } = Vue;
    const app = createApp({
      data(){
        return {
          isShow: false
        }
      },
      methods: {
        showModal(){
          this.isShow = true;
        },
        hideModal(){
          this.isShow = false;
        }
      },
    })
    app.mount('#app')
  </script>
</body>
</html>